import React from 'react'
import { } from 'antd'
import { useRequest } from 'ahooks'
import { detailReview } from '@/service/review'
import { useParams } from 'react-router-dom'
import moment from 'moment'
import MDEditor from "@uiw/react-md-editor";
import "./index.less"


const Review: React.FC = () => {

  const { id } = useParams();

  const {
    data: reviewDetail
  } = useRequest(() => detailReview({
    id: Number(id)
  }))

  return (
    <div className="review">
      <div className="date">日期：{moment(reviewDetail?.review_date).format("YYYY-MM-DD")}</div>
      <div className="r_goal"></div>
      <div className="remark" data-color-mode="light" >
        <MDEditor.Markdown
          style={{ padding : "0 0 20px 0"}}
          source={ reviewDetail?.remark }
          linkTarget="_blank"
        />
      </div>
    </div>
  )
}

export default Review

